/*****************************************************************************
State of Aadhaar Survey 2017-2018

Title: 4_Banking_pub.do
Author: IDinsight
Contact: stateofaadhaar@idinsight.org
Date: 29 August 2018
Data: "SOA2018_nonroster_cleaned_gen.dta"
User-written commands: estout (ssc install estout if not installed)
Description: 	This .do file conducts analysis for the Banking section and
				produces output tables in "4_Banking.rtf".

Contents:
	
	1. Analysis using non roster data
		- Survey set up
		- Tabulations / Proportions / Means
		- Regressions / Hypothesis tests
	
Missing data code:
	.r = refused
	.d = don't know	
*****************************************************************************/

	
* Setting up
	
	version 14
	capture log close
	clear all
	mac drop _all
	set more off
			
	* Please replace "..." below with the correct file path on your computer
	if "`c(os)'"=="MacOSX"{
		global dir "/Users/`c(username)'/.../SOA2018_data_release/"
		}
	else{
		global dir "C:/Users/`c(username)'/.../SOA2018_data_release/"
		}

/*****************************************************************************
1. Analysis using non roster data
*****************************************************************************/

	*** Survey set up

		cd "${dir}/Data_sets/"
		use "SOA2018_nonroster_cleaned_gen.dta", clear

		drop hh_id
		rename master_key hh_id 
		svyset district_id [pweight=weight_resp_adj] || AC_id || ps_id || hh_id || _n
		cd "${dir}/Output_tables/"
		

	***  Tabulations / Proportions / Means
				
		/*****************************************************************************
		* 4.1 Percentage of respondents with a bank account *
		*****************************************************************************/
		
			eststo clear
			eststo: estpost svy: tab bank, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (bank ==.d | bank ==.r) 
			loc miss = r(N)
			count if (bank ==.e) 
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab bank if state == `i',  percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (bank ==.d | bank ==.r) & state == `i'
				estadd scalar missing  = r(N)
				count if (bank ==.e) & state == `i'
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.1 Percentage of respondents with a bank account") ///	
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///		
				replace	
			eststo clear
			
			
		/*****************************************************************************
		* 4.2 Percentage of respondents by the number of bank accounts (among those who have a bank account) *
		*****************************************************************************/
		
			eststo: estpost svy: tab banknumcategories, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (banknumcategories ==.d | banknumcategories ==.r) 
			loc miss = r(N)
			count if (banknumcategories ==.e) 
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab banknumcategories if state == `i', percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (banknumcategories ==.d | banknumcategories ==.r) & state == `i'
				estadd scalar missing  = r(N)
				count if (banknumcategories ==.e) & state == `i'
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.2 Number of bank accounts owned by respondents (among those who have a bank account; numbers in percentage)") ///	
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///
				append	
			eststo clear
			
			
		/*****************************************************************************
		* 4.3 Percentage of respondents with a PMJDY bank account (among those who have at least one bank account) *
		*****************************************************************************/
				
			eststo: estpost svy: tab pmjdy, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (pmjdy ==.r) 
			loc miss = r(N)
			count if (pmjdy ==.e) 
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab pmjdy if state == `i',  percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (pmjdy ==.r) & state == `i'
				estadd scalar missing  = r(N)
				count if (pmjdy ==.e) & state == `i'
				estadd scalar er  = r(N)
				}
												
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.3 Percentage of respondents with a PMJDY bank account (among those who have a bank account)") ///
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///
				append 
			eststo clear
					
			
		*****************************************************************************
		* 4.4 Percentage of respondents who used Aadhaar in bank account opening (among those who have a bank account and those who opened their bank account in/after 2014) *
		/* Note: only running this for 2014 and after since the use of Aadhaar for bank account opnenings officially started in 2014 */
		*****************************************************************************
			
			eststo clear
			eststo: estpost svy: tab ad_bankopenhow if bank2014==1, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (ad_bankopenhow ==.d | ad_bankopenhow ==.r) & bank2014==1
			loc miss = r(N)
			count if (ad_bankopenhow ==.e)  & bank2014==1
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab ad_bankopenhow if state == `i' & bank2014==1, percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (ad_bankopenhow ==.d | ad_bankopenhow ==.r) & state == `i' & bank2014==1
				estadd scalar missing  = r(N)
				count if (ad_bankopenhow ==.e) & state == `i' & bank2014==1
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.4 Percentage of respondents who used Aadhaar in bank account opening (among those who opened their bank account in/after 2014)") ///	
				nostar ///
				coeflabels(0 "Did not use Aadhaar" 1 "Used Aadhaar as ID" 2 "Used Aadhaar e-KYC") ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///
				append	
			eststo clear 
		
		
		/*****************************************************************************
		* 4.5 Percentage of respondents who used Aadhaar in bank account opening (among those who have a bank account and those who opened their bank account before 2014) *
		*****************************************************************************/
		
			eststo clear
			eststo: estpost svy: tab ad_bankopenhow if bank2014==0, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (ad_bankopenhow ==.d | ad_bankopenhow ==.r) & bank2014==0
			loc miss = r(N)
			count if (ad_bankopenhow ==.e)  & bank2014==0
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab ad_bankopenhow if state == `i' & bank2014==0, percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (ad_bankopenhow ==.d | ad_bankopenhow ==.r) & state == `i' & bank2014==0
				estadd scalar missing  = r(N)
				count if (ad_bankopenhow ==.e) & state == `i' & bank2014==0
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.5 Percentage of respondents who used Aadhaar in bank account opening (among those who opened their bank account before 2014)") ///	
				nostar ///
				coeflabels(0 "Did not use Aadhaar" 1 "Used Aadhaar as ID" 2 "Used Aadhaar e-KYC") ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///
				append	
			eststo clear
			
			
		/*****************************************************************************
		* 4.6 Percentage of respondents who have their bank account activated in 1 day and usage of e-KYC in bank account opening (among those who have a bank account, those who opened their bank account in/after 2014, and those who DID NOT use e-KYC) *
		*****************************************************************************/
		
			eststo clear
			eststo: estpost svy: tab bankopencategories1 if ad_bankopenhow3==0 & bank2014==1, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (bankopencategories1 ==.d | bankopencategories1 ==.r) & ad_bankopenhow3==0 & bank2014==1
			loc miss = r(N)
			count if (bankopencategories1 ==.e) & ad_bankopenhow3==0 & bank2014==1
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab bankopencategories1 if state == `i' & ad_bankopenhow3==0 & bank2014==1, percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (bankopencategories1 ==.d | bankopencategories1 ==.r) & state == `i' & ad_bankopenhow3==0 & bank2014==1
				estadd scalar missing  = r(N)
				count if (bankopencategories1 ==.e) & state == `i' & ad_bankopenhow3==0 & bank2014==1
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.6.1 Percentage of respondents who had their bank account activated in 1 day, among those who did not use e-KYC (and opened their bank account in/after 2014)") ///	
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///
				append
				eststo clear
				
			eststo clear
			eststo: estpost svy: tab bankopencategories1 if ad_bankopenhow3==1 & bank2014==1, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (bankopencategories1 ==.d | bankopencategories1 ==.r) & ad_bankopenhow3==1 & bank2014==1
			loc miss = r(N)
			count if (bankopencategories1 ==.e) & ad_bankopenhow3==1 & bank2014==1
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab bankopencategories1 if state == `i' & ad_bankopenhow3==1 & bank2014==1, percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (bankopencategories1 ==.d | bankopencategories1 ==.r) & state == `i' & ad_bankopenhow3==1 & bank2014==1
				estadd scalar missing  = r(N)
				count if (bankopencategories1 ==.e) & state == `i' & ad_bankopenhow3==1 & bank2014==1
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.6.2 Percentage of respondents who had their bank account activated in 1 day, among those who used e-KYC (and opened their bank account in/after 2014)") ///	
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///
				append
				eststo clear
			
			
		/*****************************************************************************
		* 4.7 Percentage of respondents who had an acceptable proof of identity at the time of obtaining an Aadhaar among those who used Aadhaar as ID for bank account opening *
		*****************************************************************************/
			
			eststo clear
			eststo: estpost svy: tab bankidpoi if ad_bankopenhow2==1 & bank2014==1, percent nototal ci /* bankidpoi: "Did the respondent possess a legitimate proof of identity for bank openings at the time of Aadhaar enrolment?"; ad_bankopenhow2: "Used Aadhaar as ID" */
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (bankidpoi ==.d | bankidpoi ==.r) & ad_bankopenhow2==1 & bank2014==1
			loc miss = r(N)
			count if (bankidpoi ==.e) & ad_bankopenhow2==1 & bank2014==1
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab bankidpoi if state == `i' & ad_bankopenhow2==1 & bank2014==1, percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (bankidpoi ==.d | bankidpoi ==.r) & state == `i' & ad_bankopenhow2==1 & bank2014==1
				estadd scalar missing  = r(N)
				count if (bankidpoi ==.e) & state == `i' & ad_bankopenhow2==1 & bank2014==1
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.7 Percentage of respondents who had an acceptable proof of identity at the time of obtaining an Aadhaar, among those who used Aadhaar as ID for bank account opening (and opened their bank account in/after 2014)") ///	
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates." "We define proof-of-identity document as one of the following: NREGA job card, voter ID, driving license, PAN card, letter from an official government authority/panchayat, and passport.") ///
				append	
			eststo clear
	
	
		/*****************************************************************************
		* 4.8 Percentage of respondents who had an acceptable proof of address at the time of obtaining an Aadhaar among those who used Aadhaar as ID for bank account opening *
		*****************************************************************************/
			
			eststo: estpost svy: tab bankidpoa if ad_bankopenhow2==1 & bank2014==1, percent nototal ci /* bankidpoa: "Did the respondent possess a legitimate proof of address for bank openings at the time of Aadhaar enrolment?"; ad_bankopenhow2: "Used Aadhaar as ID" */
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (bankidpoa ==.d | bankidpoa ==.r) & ad_bankopenhow2==1 & bank2014==1
			loc miss = r(N)
			count if (bankidpoa ==.e) & ad_bankopenhow2==1 & bank2014==1
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab bankidpoa if state == `i' & ad_bankopenhow2==1 & bank2014==1, percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (bankidpoa ==.d | bankidpoa ==.r) & state == `i' & ad_bankopenhow2==1 & bank2014==1
				estadd scalar missing  = r(N)
				count if (bankidpoa ==.e) & state == `i' & ad_bankopenhow2==1 & bank2014==1
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.8 Percentage of respondents who had an acceptable proof of address at the time of obtaining an Aadhaar, among those who used Aadhaar as ID for bank account opening (and opened their bank account in/after 2014)") ///	
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates." "We define proofs-of-address document as one of the following: ration card, an existing bank statement, and letter from official government authority/panchayat.") ///
				append	
			eststo clear
			
			
		/*****************************************************************************
		* 4.9 Percentage of respondents who have seeded their bank accounts to Aadhaar (among those who have a bank account) *
		*****************************************************************************/
			
			eststo: estpost svy: tab bankseeded, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (bankseeded ==.r) 
			loc miss = r(N)
			count if (bankseeded ==.e) 
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab bankseeded if state == `i',  percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (bankseeded ==.r) & state == `i'
				estadd scalar missing  = r(N)
				count if (bankseeded ==.e) & state == `i'
				estadd scalar er  = r(N)
				}
			
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.9 Percentage of respondents who have seeded their bank accounts to Aadhaar (among those who have a bank account)") ///
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals in brackets." ///
				"In the survey we asked whether the respondent's most recently opened bank account had been seeded with Aadhaar. In this analysis we combine responses from those with one account and those with multiple accounts.") ///
				append	
			eststo clear 
			
			
		/*****************************************************************************
		* 4.10 Percentage of respondents by reasons for seeding bank accounts with Aadhaar (among those who seeded their bank accounts with Aadhaar) *
		*****************************************************************************/
			
			eststo clear
			tokenize `" "Because the bank required me to seed it" "Because seeding was required for me to receive a benefit from the government" "Because seeding makes it easier for me to use my bank account" "'
			forvalues k=1/3{
				eststo: estpost svy: tab bank_aadhaarwhy_`k', percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (bank_aadhaarwhy_`k' ==.d | bank_aadhaarwhy_`k' ==.r) 
				loc miss = r(N)
				count if (bank_aadhaarwhy_`k' ==.e)
				loc er = r(N)
				estadd scalar missing  = `miss'
				estadd scalar er  = `er'
				forvalues i = 1/3 {
					display `i' 
					eststo: estpost svy: tab bank_aadhaarwhy_`k' if state == `i', percent nototal ci
					estadd matrix cil = e(lb)
					estadd matrix ciu = e(ub)
					count if (bank_aadhaarwhy_`k' ==.d | bank_aadhaarwhy_`k' ==.r) & state == `i'
					estadd scalar missing  = r(N)
					count if (bank_aadhaarwhy_`k' ==.e) & state == `i'
					estadd scalar er  = r(N)
					}
					
				esttab using "4_Banking.rtf", ///
					compress ///
					collabels(none) ///
					eqlabels(none) ///
					label ///
					modelwidth(0) ///
					incelldelimiter(-) ///
					cells(b(fmt(1)) "cil & ciu") ///
					title ("Table 4.10.`k' Reasons for seeding bank accounts with Aadhaar, in percentage (among respondents who seeded their bank accounts with Aadhaar; numbers in percentage): ``k++''") ///	
					nostar ///
					nonumbers ///
					mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
					nogaps ///
					stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
					nonotes ///
					addnotes("Notes: 95% confidence intervals are under point estimates.") ///
					append	
				eststo clear	
			}
			
			
		/*****************************************************************************
		* 4.11 Percentage of respondents who have used their bank account in the last 3 months (among those who have a bank account) *
		*****************************************************************************/
		
			eststo clear
			eststo: estpost svy: tab bank_last3month, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (bank_last3month ==.d | bank_last3month ==.r) 
			loc miss = r(N)
			count if (bank_last3month ==.e)
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab bank_last3month if state == `i', percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (bank_last3month ==.d | bank_last3month ==.r) & state == `i'
				estadd scalar missing  = r(N)
				count if (bank_last3month ==.e) & state == `i'
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.11 Percentage of respondents who have used their bank account in the last 3 months (among those who have a bank account)") ///	
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///
				append	
			eststo clear
		
		
		/*****************************************************************************
		* 4.12 Percentage of respondents who have used their bank account in the last 3 months (among those who do not receive DBTs & those who do) *
		*****************************************************************************/
			
			eststo clear
			eststo: estpost svy: tab bank_last3month if dbt==0, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (bank_last3month ==.d | bank_last3month ==.r) & dbt==0
			loc miss = r(N)
			count if (bank_last3month ==.e) & dbt==0
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab bank_last3month if state == `i' & dbt==0, percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (bank_last3month ==.d | bank_last3month ==.r) & state == `i' & dbt==0
				estadd scalar missing  = r(N)
				count if (bank_last3month ==.e) & state == `i' & dbt==0
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.12.1 Percentage of respondents who have used their bank account in the last 3 months, among those who do not receive DBTs (and have a bank account)") ///	
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///
				append	
			eststo clear
			
			eststo clear
			eststo: estpost svy: tab bank_last3month if dbt==1, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (bank_last3month ==.d | bank_last3month ==.r) & dbt==1
			loc miss = r(N)
			count if (bank_last3month ==.e) & dbt==1
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab bank_last3month if state == `i' & dbt==1, percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (bank_last3month ==.d | bank_last3month ==.r) & state == `i' & dbt==1
				estadd scalar missing  = r(N)
				count if (bank_last3month ==.e) & state == `i' & dbt==1
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.12.2 Percentage of respondents who have used their bank account in the last 3 months, among those who receive DBTs (and have a bank account)") ///	
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///
				append	
			eststo clear
			
			
		/*****************************************************************************
		* 4.13 Percentage of respondents who receive DBTs (among those who have a bank account) *
		*****************************************************************************/
						
			eststo: estpost svy: tab dbt, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (dbt ==.d | dbt ==.r) 
			loc miss = r(N)
			count if (dbt ==.e)
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab dbt if state == `i', percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (dbt ==.d | dbt ==.r) & state == `i'
				estadd scalar missing  = r(N)
				count if (dbt ==.e) & state == `i'
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.13 Percentage of respondents who receive DBTs (among those who have a bank account)") ///
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///
				append	
			eststo clear
		
		
		/*****************************************************************************
		* 4.14 Percentage of respondents who receive DBTs into an Aadhaar seeded bank account (among those who receive DBTs) *
		*****************************************************************************/
			
			eststo clear
			eststo: estpost svy: tab dbt_aadhaarseeded, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (dbt_aadhaarseeded ==.d | dbt_aadhaarseeded ==.r) 
			loc miss = r(N)
			count if (dbt_aadhaarseeded ==.e)
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab dbt_aadhaarseeded if state == `i', percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (dbt_aadhaarseeded ==.d | dbt_aadhaarseeded ==.r) & state == `i'
				estadd scalar missing  = r(N)
				count if (dbt_aadhaarseeded ==.e) & state == `i'
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.14 Percentage of respondents who receive DBTs into an Aadhaar seeded bank account (among those who receive DBTs)") ///	
				nostar ///
				coeflabels(0 "Do not receive into Aadhaar-seeded bank account" 1 "Receive into Aadhaar-seeded bank account" 2 "Unable to determine whether DBT is received in an Aadhaar-seeded account or not") ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates." ///
				"In this analysis we combine responses from those with one account and those with multiple accounts. For those who receive DBTs and only have one account, we asked whether that account is seeded with Aadhaar. For those who have multiple accounts, we asked whether they receive the DBTs into any account and whether that account is seeded with Aadhaar.")	///	
				append	
			eststo clear
		
		
		/*****************************************************************************
		* 4.15 Percentage of respondents who have used a micro-ATM in the last 3 months (in the last 6 months for those who used a micro-ATM for NREGA wages in Andhra Pradesh) *
		*****************************************************************************/
		
			eststo clear
			eststo: estpost svy: tab microatm, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (microatm ==.d | microatm ==.r) 
			loc miss = r(N)
			count if (microatm ==.e)
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab microatm if state == `i', percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (microatm ==.d | microatm ==.r) & state == `i'
				estadd scalar missing  = r(N)
				count if (microatm ==.e) & state == `i'
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.15 Percentage of respondents who have used a micro-ATM in the last 3 months (in the last 6 months for those who used a micro-ATM for NREGA wages in Andhra Pradesh; among respondents with a bank account)") ///	
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates." ///
				"In this analysis we combine the responses of those who have used a micro-ATM to receive NREGA wages (only in Andhra Pradesh), and those who have not used it for NREGA, but have used it for other purposes." ///
				"In Andhra Pradesh, due to an initial error in survey skip codes, many respondents were not asked the microATM question. We conducted a follow-up phone call to reach these respondents, however, we were not able to reach all." ///
				"In Andhra Pradesh and West Bengal, there were errors due to inconsistent responses from the respondents. The instances in which respondents stated they have used a micro-ATM in the last 3 months but had previously responded they have not transacted with their bank account in the last 3 months were marked as errors, hence missing.") ///
				append	
			eststo clear
			
				
		/*****************************************************************************
		* 4.16 & 4.17 Breakdown of problems when using a micro-ATM (among those who have used a micro-ATM) *
		*****************************************************************************/
			
			/* Note: Needing to separate this analyses by state since for some variable, Rajasthan ///
				does not have any values and that causes errors in the table output  */
			
			* Additional Cleaning for the question for Rajasthan  
			
			forvalues i = 1/5 {
			replace microproblems_`i' = 0 if microproblems_`i' == . & microatm == 1	& state == 2
				}
			
			
			tokenize `" "Internet/server was not working" "Fingerprint authentication failure" "Fingerprint worked but PoS machine still gave an error" "The machine was not turning on" "No problems" "'
			
			forvalues v=1/5{
				forvalues i = 1/3 {
				eststo: estpost svy: tab microproblems_`v' if state==`i', percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (microproblems_`v' ==.d | microproblems_`v' ==.r) & state == `i'
				loc miss = r(N)
				count if (microproblems_`v' ==.e) & state == `i'
				loc er = r(N)
				estadd scalar missing  = `miss'
				estadd scalar er  = `er'
				}
				
				esttab using "4_Banking.rtf", ///
					compress ///
					collabels(none) ///
					eqlabels(none) ///
					label ///
					modelwidth(0) ///
					incelldelimiter(-) ///
					cells(b(fmt(1)) "cil & ciu") ///
					title ("Table 4.16.`v' Problems encountered when using a micro-ATM (among respondents who have used a micro-ATM): ``v++''") ///	
					nostar ///
					nonumbers ///
					mtitles ("Andhra Pradesh" "Rajasthan" "West Bengal") ///
					nogaps ///
					stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
					nonotes ///
					addnotes("Notes: 95% confidence intervals are under point estimates." ///
					"For Andhra Pradesh and West Bengal, we have removed some inconsistent responses for this question. Where a respondent* stated they had used a microATM in the last 3 months but had previously responded they had not transacted with their bank account in the last 3 months, we marked these responses as errors, hence missing. Additionally, in Andhra Pradesh, due to an initial survey skip pattern error, we made follow-up phone calls to respondents who were not initially asked relevant questions. We were unable to reach some respondents which resulted in missing observations." ///
					"In Andhra Pradesh, this questions was only asked to respondents who indicated they have used a micro-ATM outside of the context of receiving wages for NREGA.") ///
					append	
					eststo clear
				}
				

		/*****************************************************************************
		* 4.17 Percentage of respondents by how they responded when they faced a problem using a micro-ATM (among those who have faced a problem using a micro-ATM) *
		*****************************************************************************/
		
			/* Note: Conducting the following analyses separately for each state since all three states have ///
				missing values for some of the variables and that causes errors in table output */
			
			eststo: estpost svy: tab microproblemresponse if state == 1, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (microproblemresponse ==.d | microproblemresponse ==.r) & state == 1
			loc miss = r(N)
			count if (microproblemresponse ==.e) & state == 1
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.17.1 How respondents reacted when they encountered problems using a micro-ATM (among those who encountered problems using a micro-ATM; numbers in percentage) [State: Andhra Pradesh] ") ///	
				nostar ///
				coeflabels(1 "Visited the banking correspondent again next day / some other time" 3 "Went to a bank branch" 4 "Went to an ATM" 5 "Used bank/debit/ATM card on micro-ATM") ///
				nonumbers ///
				mtitles ("Andhra Pradesh") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates." "In Andhra Pradesh, this questions is only relevant to respondents who indicated they have used a micro-ATM outside of the context of receiving wages for NREGA.")	///
				append	
			eststo clear	
			
			
			eststo: estpost svy: tab microproblemresponse if state == 2, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (microproblemresponse ==.d | microproblemresponse ==.r) & state == 2
			loc miss = r(N)
			count if (microproblemresponse ==.e) & state == 2
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.17.2 How respondents reacted when they encountered problems using a micro-ATM (among those who encountered problems using a micro-ATM; numbers in percentage) [State: Rajasthan] ") ///	
				nostar ///
				coeflabels(1 "Visited the banking correspondent again next day / some other time" 2 "Used mobile one-time-password authentication" 3 "Went to a bank branch" 4 "Went to an ATM" 5 "Used bank/debit/ATM card on micro-ATM" 21 "Washed my fingers to try fingerprint authentication again") ///
				nonumbers ///
				mtitles ("Rajasthan") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.") ///
				append	
			eststo clear	
			
			eststo: estpost svy: tab microproblemresponse if state == 3, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (microproblemresponse ==.d | microproblemresponse ==.r) & state == 3
			loc miss = r(N)
			count if (microproblemresponse ==.e) & state == 3
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.17.3 How respondents reacted when they encountered problems using a micro-ATM (among those who encountered problems using a micro-ATM; numbers in percentage) [State: West Bengal] ") ///	
				nostar ///
				coeflabels(1 "Visited the banking correspondent again next day / some other time" 3 "Used a bank branch" 5 "Used bank/debit/ATM card" 6 "I borrowed money from money lender/friend/relative") ///
				nonumbers ///
				mtitles ("West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates.")	///
				append	
			eststo clear	
				
			
		/*****************************************************************************
		* 4.18 Percentage of respondents by the self-reported relative ease of transaction of micro-ATMs compared to transacting at banks (among those who have used a micro-ATM *
		*****************************************************************************/
			
			recode microease (1=2) (5=4) /* Note: converting the microease variable into a 3-point scale from a 5-point scale; 5-point scale was used in ///
				Andhra Pradesh, while only 3-point scale was used in Rajasthan and West Bengal */
			
			eststo: estpost svy: tab microease, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (microease ==.d | microease ==.r) 
			loc miss = r(N)
			count if (microease ==.e)
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab microease if state == `i', percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (microease ==.d | microease ==.r) & state == `i'
				estadd scalar missing  = r(N)
				count if (microease ==.e) & state == `i'
				estadd scalar er  = r(N)
				}
				
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.18 Perceived relative ease of transaction using micro-ATMs compared to transacting at banks (among those who have used a micro-ATM; numbers in percentage)") ///	
				nostar ///
				coeflabels(2 "Easier" 3 "Neither easier nor more difficult" 4 "More difficult") ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates." ///
				"Respondents were asked: 'Overall, has using a microATM made it easier or more difficult to withdraw money, deposit money, etc.?' and were given the options of 'Easier', 'Neither easier nor more difficult', and 'More difficult' to choose from. This question was only asked to respondents who used both micro-ATMs and banks in the past 3 months. In Andhra Pradesh, this questions was only asked to respondents who indicated they have used a micro-ATM outside of the context of receiving wages for NREGA.")	///
				append
			eststo clear
	
	
		/*****************************************************************************
		* 4.19 Percentage of respondents by why they find it easier to use a micro-ATM (among those who said it is easier to use a micro-ATM than a bank) *
		*****************************************************************************/
		
			tokenize `" "It is closer to me so I do not have to travel too much" "The lines are not too long" "It is faster to use a micro-ATM to get money than getting money from bank branch" "'
			
			forvalues v=1/3{
				eststo: estpost svy: tab microeasewhy_`v', percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (microeasewhy_`v' ==.d | microeasewhy_`v' ==.r) 
				loc miss = r(N)
				count if (microeasewhy_`v' ==.e) 
				loc er = r(N)
				estadd scalar missing  = `miss'
				estadd scalar er  = `er'
					forvalues i = 1/3 {
				eststo: estpost svy: tab microeasewhy_`v' if state==`i', percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (microeasewhy_`v' ==.d | microeasewhy_`v' ==.r) & state == `i'
				loc miss = r(N)
				count if (microeasewhy_`v' ==.e) & state == `i'
				loc er = r(N)
				estadd scalar missing  = `miss'
				estadd scalar er  = `er'
					}
				
				esttab using "4_Banking.rtf", ///
					compress ///
					collabels(none) ///
					eqlabels(none) ///
					label ///
					modelwidth(0) ///
					incelldelimiter(-) ///
					cells(b(fmt(1)) "cil & ciu") ///
					title ("Table 4.19.`v' Problems encountered when using a micro-ATM (among respondents who have used a micro-ATM): ``v++''") ///	
					nostar ///
					nonumbers ///
					mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
					nogaps ///
					stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
					nonotes ///
					addnotes("Notes: 95% confidence intervals are under point estimates." "In Andhra Pradesh, this questions was only asked to respondents who indicated they have used a micro-ATM outside of the context of receiving wages for NREGA.") ///
					append
					eststo clear
			}
		
		
		/*****************************************************************************
		* 4.20 Percentage of respondents who are 'JAM candidates' *
		*****************************************************************************/
			
			eststo: estpost svy: tab jamcandidate, percent nototal ci
			estadd matrix cil = e(lb)
			estadd matrix ciu = e(ub)
			count if (jamcandidate ==.m) 
			loc miss = r(N)
			count if (jamcandidate ==.e)
			loc er = r(N)
			estadd scalar missing  = `miss'
			estadd scalar er  = `er'
			forvalues i = 1/3 {
				display `i' 
				eststo: estpost svy: tab jamcandidate if state == `i', percent nototal ci
				estadd matrix cil = e(lb)
				estadd matrix ciu = e(ub)
				count if (jamcandidate ==.m) & state == `i'
				estadd scalar missing  = r(N)
				count if (jamcandidate ==.e) & state == `i'
				estadd scalar er  = r(N)
			}
			
			esttab using "4_Banking.rtf", ///
				compress ///
				collabels(none) ///
				eqlabels(none) ///
				label ///
				modelwidth(0) ///
				incelldelimiter(-) ///
				cells(b(fmt(1)) "cil & ciu") ///
				title ("Table 4.20 Percentage of respondents who are 'JAM candidates'") ///	
				nostar ///
				nonumbers ///
				mtitles ("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				nogaps ///
				stats(N missing, fmt(0) label("Number of observations" "Number of missing observations (don't know / refused)")) ///
				nonotes ///
				addnotes("Notes: 95% confidence intervals are under point estimates." "A 'JAM candidate' is someone who possesses a PMDJY bank account, an Aadhaar and a mobile phone.") ///
				append	
			eststo clear


			
	***  Regressions / Hypothesis tests
	
						
		/*****************************************************************************
		* 4.21 Hypothesis tests of bank account ownership and demographic details of individuals
		*****************************************************************************/
			
			* Pooled
			
			local depvar bank
			local tabletitle "Owns bank account"
			eststo clear	
			loc option append
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var'
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) 
					loc miss = r(N)
					count if (`depvar' ==.e) 
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.21.1 Hypothesis tests of differences in bank account ownership among respondents from different vulnerable communities [All three states]") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"We test the null hypotheses that there are no differences in the likelihood of owning a bank account for enrolment between vulnerable respondents and other respondents, with vulnerability being proxied by each of the categories above. Each column presents coefficients from a regression of the outcome variable on a dummy variable for the corresponding category and a constant. Hence we separately examine whether each individual type above has a different likelihood of owning a bank account compared to all other individuals (i.e. all those not in the specified type).")	///
					`option'
					loc option append
			
			
			* By state
			
			local depvar bank
			local tabletitle "Owns bank account"
			eststo clear	
			tokenize `" "Andhra Pradesh" "Rajasthan" "West Bengal" "'
			loc option append
			forv i = 1/3{
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var' if state == `i'
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) & state == `i'
					loc miss = r(N)
					count if (`depvar' ==.e) & state == `i'
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			local k = `i' + 1	
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.21.`k' Hypothesis tests of differences in bank account ownership among respondents from different vulnerable communities [State: ``i++'']") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"See footnote to Table 4.21.1 for a description of the hypotheses tested here.")	///
					`option'
					loc option append
				}
		
		
		/*****************************************************************************
		* 4.22 Hypothesis tests of differences in usage of Aadhaar as ID in bank account openings among respondents from different vulnerable communities
		*****************************************************************************/
			
			* Pooled
			
			local depvar ad_bankopenhow2
			local tabletitle "Used Aadhaar as ID"
			eststo clear	
			loc option append
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var' if bank2014==1
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) & bank2014==1
					loc miss = r(N)
					count if (`depvar' ==.e) & bank2014==1
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.22.1 Hypothesis tests of differences in usage of Aadhaar as ID in bank account openings among respondents from different vulnerable communities [All three states]") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"We test the null hypotheses that there are no differences in the likelihood of using Aadhaar in opening of bank accounts between vulnerable respondents and other respondents, with vulnerability being proxied by each of the categories above. Each column presents coefficients from a regression of the outcome variable on a dummy variable for the corresponding category and a constant. Hence we separately examine whether each individual type above has a different likelihood of using Aadhaar in opening of bank accounts compared to all other individuals (i.e. all those not in the specified type).")	///
					`option'
					loc option append
			
			* By state
			
			local depvar ad_bankopenhow2
			local tabletitle "Used Aadhaar as ID"
			eststo clear	
			tokenize `" "Andhra Pradesh" "Rajasthan" "West Bengal" "'
			loc option append
			forv i = 1/3{
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var' if state == `i' & bank2014==1
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) & state == `i' & bank2014==1
					loc miss = r(N)
					count if (`depvar' ==.e) & state == `i' & bank2014==1
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			local k = `i' + 1	
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.22.`k' Hypothesis tests of differences in usage of Aadhaar as ID in bank account openings among respondents from different vulnerable communities [State: ``i++'']") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"See footnote to Table 4.22.1 for a description of the hypotheses tested here.")	///
					`option'
					loc option append
				}
			
		
		/*****************************************************************************
		* 4.23 Hypothesis tests of differences in usage of Aadhaar e-KYC in bank account openings among respondents from different vulnerable communities
		*****************************************************************************/
			
			* Pooled
			
			local depvar ad_bankopenhow3
			local tabletitle "Used Aadhaar e-KYC"
			eststo clear	
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var' if bank2014==1
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) & bank2014==1
					loc miss = r(N)
					count if (`depvar' ==.e) & bank2014==1
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.23.1 Hypothesis tests of differences in usage of Aadhaar e-KYC in bank account openings among respondents from different vulnerable communities [All three states]") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"We test the null hypotheses that there are no differences in the likelihood of using Aadhaar e-KYC in opening of bank accounts between vulnerable respondents and other respondents, with vulnerability being proxied by each of the categories above. Each column presents coefficients from a regression of the outcome variable on a dummy variable for the corresponding category and a constant. Hence we separately examine whether each individual type above has a different likelihood of using Aadhaar e-KYC in opening of bank accounts compared to all other individuals (i.e. all those not in the specified type).")	///
					append
			
			
			* By state
			
			local depvar ad_bankopenhow3
			local tabletitle "Used Aadhaar e-KYC"
			eststo clear	
			tokenize `" "Andhra Pradesh" "Rajasthan" "West Bengal" "'
			forv i = 1/3{
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var' if state == `i' & bank2014==1
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) & state == `i' & bank2014==1
					loc miss = r(N)
					count if (`depvar' ==.e) & state == `i' & bank2014==1
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			local k = `i' + 1	
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.23.`k' Hypothesis tests of differences in usage of Aadhaar e-KYC in bank account openings among respondents from different vulnerable communities [State: ``i++'']") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"See footnote to Table 4.23.1 for a description of the hypotheses tested here.")	///
					append
					loc option append
			}
		
		
		/*****************************************************************************
		* 4.24 Hypothesis tests of differences in usage of Aadhaar as ID in bank account openings by PMJDY account holders
		*****************************************************************************/
		
			local depvar ad_bankopenhow2
			local tabletitle "Used Aadhaar as ID"
			local var pmjdy3
			eststo clear
			
			* Pooled
			
				qui svy: regress `depvar' `var' if bank2014==1 & bank_no==1
				gen sample = e(sample)
				count if (`depvar' ==.d | `depvar' ==.r) & bank2014==1 & bank_no==1
				loc miss = r(N)
				count if (`depvar' ==.e) & bank2014==1 & bank_no==1
				loc errors = r(N)
				
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
			
			* By state
			
			forvalues i=1/3{
				qui svy: regress `depvar' `var' if state==`i' & bank2014==1 & bank_no==1
				gen sample = e(sample)
				count if (`depvar'==.d | `depvar'==.r) & state==`i' & bank2014==1 & bank_no==1
				loc miss = r(N)
				count if (`depvar'==.e) & state==`i' & bank2014==1 & bank_no==1
				loc errors = r(N)
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
			}
			esttab using "4_Banking.rtf", ///
				compress ///
				eqlabels(none) ///
				label ///
				title ("Table 4.24 Hypothesis tests of differences in usage of Aadhaar as ID in bank account openings by PMJDY account ownership (among those who have only one bank account and opened their bank account in/after 2014)") ///	
				mtitles("Andhra Pradesh" "Rajasthan" "West Bengal") ///
				p ///
				star (* 0.1 ** 0.05 *** 0.01) ///
				lines ///
				b (3) ///
				p (2) ///
				nogaps ///
				stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
				nonotes ///
				addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table."	///
				"We test the null hypothesis that there is no difference in the likelihood of using Aadhaar as ID in opening of bank accounts between PMJDY account holders and other respondents. Aadhaar usage for bank account opening was allowed in late 2013; therefore we look at the usage of Aadhaar in bank account openings starting 2014. In addition, we limit this analysis to those with only one account to be sure that the analysis is relevant for the PMJDY accounts only.")	///
				append
			
		
		/*****************************************************************************
		* 4.25 Hypothesis tests of differences in usage of Aadhaar e-KYC in bank account openings by PMJDY account holders
		*****************************************************************************/
			
			local depvar ad_bankopenhow3
			local tabletitle "Used Aadhaar e-KYC"
			local var pmjdy3
			eststo clear
			
			* Pooled
				qui svy: regress `depvar' `var' if bank2014==1 & bank_no==1
				gen sample = e(sample)
				count if (`depvar' ==.d | `depvar' ==.r) & bank2014==1 & bank_no==1
				loc miss = r(N)
				count if (`depvar' ==.e) & bank2014==1 & bank_no==1
				loc errors = r(N)
				
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
				
			* By state
			forvalues i=1/3{
				qui svy: regress `depvar' `var' if state==`i' & bank2014==1 & bank_no==1
				gen sample = e(sample)
				count if (`depvar'==.d | `depvar'==.r) & state==`i' & bank2014==1 & bank_no==1
				loc miss = r(N)
				count if (`depvar'==.e) & state==`i' & bank2014==1 & bank_no==1
				loc errors = r(N)
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
			}
			esttab using "4_Banking.rtf", ///
				compress ///
				eqlabels(none) ///
				label ///
				title ("Table 4.25 Hypothesis tests of differences in usage of Aadhaar e-KYC in bank account openings by PMJDY account ownership (among those who have only one bank account and  opened their bank account in/after 2014)") ///
				mtitles("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				p ///
				star (* 0.1 ** 0.05 *** 0.01) ///
				lines ///
				b (3) ///
				p (2) ///
				nogaps ///
				stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
				nonotes ///
				addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table."	///
				"We test the null hypothesis that there is no difference in the likelihood of using Aadhaar e-KYC in opening of bank accounts between PMJDY account holders and other respondents. Aadhaar usage for bank account opening was allowed in late 2013; therefore we look at the usage of Aadhaar in bank account openings starting 2014. In addition, we limit this analysis to those with only one account to be sure that the analysis is relevant for the PMJDY accounts only.")	///
				append
			
		
		/*****************************************************************************
		* 4.26 Hypothesis tests of differences in bank account opening times and usage of Aadhaar as ID
		*****************************************************************************/
			
			local depvar bankopencategories1
			local tabletitle "Bank account activated in 1 day"
			local var ad_bankopenhow2
			eststo clear
			
			* Pooled
				qui svy: regress `depvar' `var' if bank2014==1
				gen sample = e(sample)
				count if (`depvar' ==.d | `depvar' ==.r) & bank2014==1
				loc miss = r(N)
				count if (`depvar' ==.e) & bank2014==1
				loc errors = r(N)
				
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
				
			* By state
			forvalues i=1/3{
				qui svy: regress `depvar' `var' if state==`i' & bank2014==1
				gen sample = e(sample)
				count if (`depvar'==.d | `depvar'==.r) & state==`i' & bank2014==1
				loc miss = r(N)
				count if (`depvar'==.e) & state==`i' & bank2014==1
				loc errors = r(N)
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
			}
			esttab using "4_Banking.rtf", ///
				compress ///
				eqlabels(none) ///
				label ///
				title ("Table 4.26 Hypothesis tests of differences in likelihood of having bank account activated in 1 day by usage of Aadhaar as ID (among those who have a bank account and those who opened their bank account in/after 2014)") ///	
				mtitles("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				p ///
				star (* 0.1 ** 0.05 *** 0.01) ///
				lines ///
				b (3) ///
				p (2) ///
				nogaps ///
				stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
				nonotes ///
				addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
				"We test the null hypothesis that there is no difference in the likelihood of having their bank account activated in 1 day between respondents who used  Aadhaar as ID for bank account opening and other respondents.")	///
				append
				
			
		/*****************************************************************************
		* 4.27 Hypothesis tests of differences in bank account opening times and usage of Aadhaar e-KYC
		*****************************************************************************/
		
			local depvar bankopencategories1
			local tabletitle "Bank account activated in 1 day"
			local var ad_bankopenhow3
			eststo clear
			
			* Pooled
				qui svy: regress `depvar' `var' if bank2014==1
				gen sample = e(sample)
				count if (`depvar' ==.d | `depvar' ==.r) & bank2014==1
				loc miss = r(N)
				count if (`depvar' ==.e) & bank2014==1
				loc errors = r(N)
				
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
				
			* By state
			forvalues i=1/3{
				qui svy: regress `depvar' `var' if state==`i' & bank2014==1
				gen sample = e(sample)
				count if (`depvar'==.d | `depvar'==.r) & state==`i' & bank2014==1
				loc miss = r(N)
				count if (`depvar'==.e) & state==`i' & bank2014==1
				loc errors = r(N)
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
			}
			esttab using "4_Banking.rtf", ///
				compress ///
				eqlabels(none) ///
				label ///
				title ("Table 4.27 Hypothesis tests of differences in likelihood of having bank account activated in 1 day by usage of Aadhaar e-KYC (among those who have a bank account and those who opened their bank account in/after 2014)") ///	
				mtitles("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				p ///
				star (* 0.1 ** 0.05 *** 0.01) ///
				lines ///
				b (3) ///
				p (2) ///
				nogaps ///
				stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
				nonotes ///
				addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
				"We test the null hypothesis that there is no difference in the likelihood of having their bank account activated in 1 day between respondents who used Aadhaar e-KYC bank account opening and other respondents. (We discuss this result on p19 of the State of Aadhaar Report 2017-18.)")	///
				append
		
		
		/*****************************************************************************
		* 4.28 Hypothesis tests of differences in Aadhaar seeding of bank account among respondents from different vulnerable communities
		*****************************************************************************/
					
			* Pooled
			
			local depvar bankseeded3
			local tabletitle "Seeding bank account to Aadhaar"
			eststo clear	
			loc option append
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var'
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r)
					loc miss = r(N)
					count if (`depvar' ==.e)
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.28.1 Hypothesis tests of differences in Aadhaar seeding of bank account among respondents from different vulnerable communities (among those who have a bank account) [All three states]") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"We test the null hypotheses that there are no differences in the likelihood of seeding their bank accounts with Aadhaar between vulnerable respondents and other respondents, with vulnerability being proxied by each of the categories above. Each column presents coefficients from a regression of the outcome variable on a dummy variable for the corresponding category and a constant. Hence we separately examine whether each individual type above has a different likelihood of seeding their bank accounts with Aadhaar compared to all other individuals (i.e. all those not in the specified type).")	///
					`option'
					loc option append
			
			* By state
			
			local depvar bankseeded3
			local tabletitle "Seeding bank account to Aadhaar"
			eststo clear	
			tokenize `" "Andhra Pradesh" "Rajasthan" "West Bengal" "'
			loc option append
			forv i = 1/3{
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var' if state == `i'
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) & state == `i'
					loc miss = r(N)
					count if (`depvar' ==.e) & state == `i'
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			local k = `i' + 1	
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.28.`k' Hypothesis tests of differences in Aadhaar seeding of bank account among respondents from different vulnerable communities (among those who have a bank account) [State: ``i++'']") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"See footnote to Table 4.28.1 for a description of the hypotheses tested here.")	///
					`option'
					loc option append
			}
		
		
		/*****************************************************************************
		* 4.29 Hypothesis tests of differences in active usage of bank account among respondents from different vulnerable communities
		*****************************************************************************/
					
			* Pooled
			
			local depvar bank_last3month
			local tabletitle "Used bank account in the past 3 months"
			eststo clear	
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var' 
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) 
					loc miss = r(N)
					count if (`depvar' ==.e) 
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.29.1 Hypothesis tests of differences in active usage of bank account among respondents from different vulnerable communities (among those who have a bank account) [All three states]") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"We test the null hypotheses that there are no differences in the likelihood of using their bank account in the last 3 months between vulnerable respondents and other respondents, with vulnerability being proxied by each of the categories above. Each column presents coefficients from a regression of the outcome variable on a dummy variable for the corresponding category and a constant. Hence we separately examine whether each individual type above has a different likelihood of using their bank account in the last 3 months compared to all other individuals (i.e. all those not in the specified type).")	///
					`option'
					loc option append
			
			* By state
			
			local depvar bank_last3month
			local tabletitle "Used bank account in the past 3 months"
			eststo clear	
			tokenize `" "Andhra Pradesh" "Rajasthan" "West Bengal" "'
			forv i = 1/3{
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var' if state == `i'
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) & state == `i'
					loc miss = r(N)
					count if (`depvar' ==.e) & state == `i'
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			local k = `i' + 1	
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.29.`k' Hypothesis tests of differences in active usage of bank account among respondents from different vulnerable communities (among those who have a bank account) [State: ``i++'']") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"See footnote to Table 4.29.1 for a description of the hypotheses tested here.")	///
					`option'
					loc option append
			}
		
		
		/*****************************************************************************
		* 4.30 Hypothesis tests of differences in active usage of bank account and recipients of direct benefit transfers (DBTs)
		*****************************************************************************/
			
			local depvar bank_last3month
			local tabletitle "Used bank account in the past 3 months"
			local var dbt
			eststo clear
			
			* Pooled
			
				qui svy: regress `depvar' `var'
				gen sample = e(sample)
				count if (`depvar' ==.d | `depvar' ==.r)
				loc miss = r(N)
				count if (`depvar' ==.e)
				loc errors = r(N)
				
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
				
			* By state
			
			forvalues i=1/3{
				qui svy: regress `depvar' `var' if state==`i'
				gen sample = e(sample)
				count if (`depvar'==.d | `depvar'==.r) & state==`i'
				loc miss = r(N)
				count if (`depvar'==.e) & state==`i'
				loc errors = r(N)
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
			}
			esttab using "4_Banking.rtf", ///
				compress ///
				eqlabels(none) ///
				label ///
				title ("Table 4.30 Hypothesis tests of differences in active usage of bank account by recipient status of direct benefit transfers (DBTs) (among those who have a bank account)") ///	
				mtitles("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				p ///
				star (* 0.1 ** 0.05 *** 0.01) ///
				lines ///
				b (3) ///
				p (2) ///
				nogaps ///
				stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
				nonotes ///
				addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
				"We test the null hypothesis that there is no difference in the likelihood of using their bank account in the last 3 months between respondents who receive DBTs and other respondents. (We discuss this result on p21 of the State of Aadhaar Report 2017-18.)")	///
				append
				
				
		/*****************************************************************************
		* 4.31 Hypothesis tests of differences in active usage of bank account and usage of Aadhaar as ID in bank account opening
		*****************************************************************************/
		
			local depvar bank_last3month
			local tabletitle "Used bank account in the past 3 months"
			local var ad_bankopenhow2
			eststo clear
			
			* Pooled
			
				qui svy: regress `depvar' `var' if bank2014==1
				gen sample = e(sample)
				count if (`depvar' ==.d | `depvar' ==.r) & bank2014==1
				loc miss = r(N)
				count if (`depvar' ==.e) & bank2014==1
				loc errors = r(N)
				
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
				
			* By state
			
			forvalues i=1/3{
				qui svy: regress `depvar' `var' if state==`i' & bank2014==1
				gen sample = e(sample)
				count if (`depvar'==.d | `depvar'==.r) & state==`i' & bank2014==1
				loc miss = r(N)
				count if (`depvar'==.e) & state==`i' & bank2014==1
				loc errors = r(N)
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
			}
			esttab using "4_Banking.rtf", ///
				compress ///
				eqlabels(none) ///
				label ///
				title ("Table 4.31 Hypothesis tests of differences in active usage of bank account by usage of Aadhaar as ID in bank account opening (among those who have a bank account and those who opened their bank account in/after 2014)") ///	
				mtitles("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				p ///
				star (* 0.1 ** 0.05 *** 0.01) ///
				lines ///
				b (3) ///
				p (2) ///
				nogaps ///
				stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
				nonotes ///
				addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
				"We test the null hypothesis that there is no difference in the likelihood of using their bank account in the last 3 months between respondents who used Aadhaar in bank account opening and other respondents.")	///
				append
			
			
		/*****************************************************************************
		* 4.32 Hypothesis tests of differences in active usage of bank account and usage of Aadhaar as e-KYC in bank account opening
		*****************************************************************************/
		
			local depvar bank_last3month
			local tabletitle "Used bank account in the past 3 months"
			local var ad_bankopenhow3
			eststo clear
			
			* Pooled
			
				qui svy: regress `depvar' `var' if bank2014==1
				gen sample = e(sample)
				count if (`depvar' ==.d | `depvar' ==.r) & bank2014==1
				loc miss = r(N)
				count if (`depvar' ==.e) & bank2014==1
				loc errors = r(N)
				
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
				
			* By state	
			
			forvalues i=1/3{
				qui svy: regress `depvar' `var' if state==`i' & bank2014==1
				gen sample = e(sample)
				count if (`depvar'==.d | `depvar'==.r) & state==`i' & bank2014==1
				loc miss = r(N)
				count if (`depvar'==.e) & state==`i' & bank2014==1
				loc errors = r(N)
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
			}
			esttab using "4_Banking.rtf", ///
				compress ///
				eqlabels(none) ///
				label ///
				title ("Table 4.32 Hypothesis tests of differences in active usage of bank account by usage of Aadhaar e-KYC in bank account opening (among those who have a bank account and those who opened their bank account in/after 2014)") ///	
				mtitles("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				p ///
				star (* 0.1 ** 0.05 *** 0.01) ///
				lines ///
				b (3) ///
				p (2) ///
				nogaps ///
				stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
				nonotes ///
				addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
				"We test the null hypothesis that there is no difference in the likelihood of using their bank account in the last 3 months between respondents who used Aadhaar e-KYC in bank account opening and other respondents.")	///
				append
			
			
		/*****************************************************************************
		* 4.33 Hypothesis tests of differences in DBT recipients among respondents from different vulnerable communities
		*****************************************************************************/

			* Pooled
			
			local depvar dbt
			local tabletitle "DBT recipients"
			eststo clear	
			loc option append
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var'
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) 
					loc miss = r(N)
					count if (`depvar' ==.e)
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
				esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.33.1 Hypothesis tests of differences in DBT recipient status among respondents from different vulnerable communities (among those who have a bank account) [All three states]") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"We test the null hypotheses that there are no differences in the likelihood of receiving DBTs between vulnerable respondents and other respondents, with vulnerability being proxied by each of the categories above. Each column presents coefficients from a regression of the outcome variable on a dummy variable for the corresponding category and a constant. Hence we separately examine whether each individual type above has a different likelihood of receiving DBTs compared to all other individuals (i.e. all those not in the specified type).")	///
					`option'
					loc option append
			
			* By state
			
			local depvar dbt
			local tabletitle "DBT recipients"
			eststo clear	
			tokenize `" "Andhra Pradesh" "Rajasthan" "West Bengal" "'
			loc option append
			forv i = 1/3{
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var' if state == `i'
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) & state == `i'
					loc miss = r(N)
					count if (`depvar' ==.e) & state == `i'
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			local k = `i' + 1	
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.33.`k' Hypothesis tests of differences in DBT recipient status among respondents from different vulnerable communities (among those who have a bank account) [State: ``i++'']") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"See footnote to Table 4.33.1 for a description of the hypotheses tested here.")	///
					`option'
					loc option append
			}
			
		
		/*****************************************************************************
		* 4.34 Hypothesis tests of micro-ATM usage in the last 3 months among respondents from different vulnerable communities
		*****************************************************************************/
			
			* Pooled
			
			local depvar microatm
			local tabletitle "Used micro-ATM"
			eststo clear	
			loc option append
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var' 
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) 
					loc miss = r(N)
					count if (`depvar' ==.e) 
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
				esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.34.1 Hypothesis tests of differences in micro-ATM usage in the last 3 months among respondents from different vulnerable communities (among those who have a bank account) [All three states]") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"We test the null hypotheses that there are no differences in the likelihood of using micro-ATMs (in the last 3 months) between vulnerable respondents and other respondents, with vulnerability being proxied by each of the categories above. Each column presents coefficients from a regression of the outcome variable on a dummy variable for the corresponding category and a constant. Hence we separately examine whether each individual type above has a different likelihood of using micro-ATMs (in the last 3 months) compared to all other individuals (i.e. all those not in the specified type).")	///
					`option'
					loc option append
			
			* By state
			
			local depvar microatm
			local tabletitle "Used micro-ATM"
			eststo clear	
			tokenize `" "Andhra Pradesh" "Rajasthan" "West Bengal" "'
			loc option append
			forv i = 1/3{
				eststo clear
				local regressors `" "sc_cat st_cat" rel_muslim resp_female resp_noschool resp_above60"'
				local j = 1
				foreach var in `regressors'{
					qui svy: regress `depvar' `var' if state == `i'
					gen sample = e(sample)
					count if (`depvar' ==.d | `depvar'==.r) & state == `i'
					loc miss = r(N)
					count if (`depvar' ==.e) & state == `i'
					loc errors = r(N)
					
					preserve
					keep if sample == 1
					svy: mean `var'
					if `j++'==1{
						loc x1 = _b[sc_cat] 
						loc x2 = _b[st_cat]
					}
					else{
						loc x1 = _b[`var']
						loc x2 = .
					}
					svy: mean `depvar'
					loc y1 = _b[`depvar']
					eststo: svy: regress `depvar' `var'
					estadd scalar missing = `miss'
					estadd scalar errors = `errors'
					estadd scalar y = `y1'
					estadd scalar x = `x1'
					estadd scalar z = `x2'
					restore
					drop sample
				}
			local k = `i' + 1	
			esttab using "4_Banking.rtf", ///
					compress ///
					eqlabels(none) ///
					label ///
					title ("Table 4.34.`k' Hypothesis tests of differences in micro-ATM usage in the last 3 months among respondents from different vulnerable communities (among those who have a bank account) [State: ``i++'']") ///	
					coeflabels (sc_cat "SC respondent" st_cat "ST respondent" rel_muslim "Muslim respondent" resp_noschool  "Respondent has not attended school" resp_female "Female respondent" resp_above60 "Respondent above age 60") ///
					mtitles ("`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'" "`tabletitle'") ///
					p ///
					star (* 0.1 ** 0.05 *** 0.01) ///
					lines ///
					b (3) ///
					p (2) ///
					nogaps ///
					stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
					nonotes ///
					addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
					"See footnote to Table 4.34.1 for a description of the hypotheses tested here.")	///
					`option'
					loc option append
				}
			
			
		/*****************************************************************************
		* 4.35 Hypothesis tests of differences in ease of opening bank account and usage of Aadhaar as e-KYC in bank account opening
		*****************************************************************************/
		
			local depvar bankopen_ease3
			local tabletitle "Bank account opening was easy"
			local var ad_bankopenhow3
			eststo clear
			* All three states *
				qui svy: regress `depvar' `var' if bank2014==1
				gen sample = e(sample)
				count if (`depvar' ==.d | `depvar' ==.r) & bank2014==1
				loc miss = r(N)
				count if (`depvar' ==.e) & bank2014==1
				loc errors = r(N)
				
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
			forvalues i=1/3{
				qui svy: regress `depvar' `var' if state==`i' & bank2014==1
				gen sample = e(sample)
				count if (`depvar'==.d | `depvar'==.r) & state==`i' & bank2014==1
				loc miss = r(N)
				count if (`depvar'==.e) & state==`i' & bank2014==1
				loc errors = r(N)
				preserve
				keep if sample == 1
				svy: mean `var'
				loc x1 = _b[`var']
				svy: mean `depvar'
				loc y1 = _b[`depvar']
				eststo: svy: regress `depvar' `var'
				estadd scalar missing = `miss'
				estadd scalar errors = `errors'
				estadd scalar y = `y1'
				estadd scalar x = `x1'
				restore
				drop sample
			}
			esttab using "4_Banking.rtf", ///
				compress ///
				eqlabels(none) ///
				label ///
				title ("Table 4.35 Hypothesis tests of differences in perceived ease of bank account opening by usage of Aadhaar as e-KYC in bank account opening (among those who have a bank account and those who opened their bank account in/after 2014)") ///	
				mtitles("All three states" "Andhra Pradesh" "Rajasthan" "West Bengal") ///
				p ///
				star (* 0.1 ** 0.05 *** 0.01) ///
				lines ///
				b (3) ///
				p (2) ///
				nogaps ///
				stats(N r2 y, fmt(0 3 3) label("Number of observations" "R-squared" "Mean of dependent variable")) ///
				nonotes ///
				addnotes("Notes: p-values in parentheses, with ***, **, * indicating significance at 1, 5 and 10%. No correction for multiple hypothesis testing has been applied to the results in the table." ///
				"We test the null hypothesis that there is no difference in the perceived ease of the process of opening their bank account between respondents who used Aadhaar e-KYC in bank account opening and other respondents.")	///
				append
